$(document).ready(function()
{
	var options = {
		target: '#response_div',
		beforeSubmit: preRequest,
		success: postResponse
	};

	$('#vehiculo_form').ajaxForm(options);
});

function preRequest(formData, jqForm, options)
{
	$('#vehiculo_form_div').hide();
	$('#loader_div').show();
	return true;
}

function postResponse(responseText, statusText, xhr, $form)
{
	$('#loader_div').hide();
	//$('#response_div').show();
	//$('#previous_vehicles').hide();
	$('#add_vehicle').hide();
	$('#previous_vehicles').show();
	$('#previous_vehicles').load(
		$('#vehiculo_form').attr('action')
	);
	//$('#response_div').hide();
}
